// 二叉搜索树的中序遍历为递增序列

var kthLargest = function (root, k) {
  let res = [];
  var dfs = function (root) {
    if (!root) return;
    dfs(root.right);
    res.push(root.val);
    dfs(root.left);
  };
  dfs(root);
  return res[k - 1];
};
